/*
 * Powered By [rapid-framework]
 * Web Site: http://www.rapid-framework.org.cn
 * Google Code: http://code.google.com/p/rapid-framework/
 * Since 2008 - 2010
 */

package com.osgix.authorize.model;

import javax.persistence.Id;

import org.apache.commons.lang.builder.EqualsBuilder;
import org.apache.commons.lang.builder.HashCodeBuilder;
import org.apache.commons.lang.builder.ToStringBuilder;
import org.apache.commons.lang.builder.ToStringStyle;

import com.osgix.common.orm.ibatis.BaseEntity;

public class RolePrivilege extends BaseEntity implements java.io.Serializable {
	private static final long serialVersionUID = 5454155825314635342L;

	//alias
	public static final String TABLE_ALIAS = "RolePrivilege";
	public static final String ALIAS_ROLE_PRIVILEGE_ID = "rolePrivilegeId";
	public static final String ALIAS_ROLE_INFO_ID = "roleInfoId";
	public static final String ALIAS_PRIVILEGE_INFO_ID = "privilegeInfoId";

	//date formats

	//可以直接使用: @Length(max=50,message="用户名长度不能大于50")显示错误消息
	//columns START
	@Id
	private java.lang.Long rolePrivilegeId;

	private java.lang.Long roleInfoId;

	private java.lang.Long privilegeInfoId;

	//columns END

	public RolePrivilege() {
	}

	public RolePrivilege(java.lang.Long rolePrivilegeId) {
		this.rolePrivilegeId = rolePrivilegeId;
	}

	public void setRolePrivilegeId(java.lang.Long value) {
		this.rolePrivilegeId = value;
	}

	public java.lang.Long getRolePrivilegeId() {
		return this.rolePrivilegeId;
	}

	public void setRoleInfoId(java.lang.Long value) {
		this.roleInfoId = value;
	}

	public java.lang.Long getRoleInfoId() {
		return this.roleInfoId;
	}

	public void setPrivilegeInfoId(java.lang.Long value) {
		this.privilegeInfoId = value;
	}

	public java.lang.Long getPrivilegeInfoId() {
		return this.privilegeInfoId;
	}

	private RoleInfo roleInfo;

	public void setRoleInfo(RoleInfo roleInfo) {
		this.roleInfo = roleInfo;
	}

	public RoleInfo getRoleInfo() {
		return roleInfo;
	}

	private PrivilegeInfo privilegeInfo;

	public void setPrivilegeInfo(PrivilegeInfo privilegeInfo) {
		this.privilegeInfo = privilegeInfo;
	}

	public PrivilegeInfo getPrivilegeInfo() {
		return privilegeInfo;
	}

	public String toString() {
		return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE)
				.append("RolePrivilegeId", getRolePrivilegeId()).append("RoleInfoId", getRoleInfoId())
				.append("PrivilegeInfoId", getPrivilegeInfoId()).toString();
	}

	public int hashCode() {
		return new HashCodeBuilder().append(getRolePrivilegeId()).toHashCode();
	}

	public boolean equals(Object obj) {
		if (obj instanceof RolePrivilege == false)
			return false;
		if (this == obj)
			return true;
		RolePrivilege other = (RolePrivilege) obj;
		return new EqualsBuilder().append(getRolePrivilegeId(), other.getRolePrivilegeId()).isEquals();
	}
}
